<template>
  <div v-html="msg" class="content">{{msg}}</div>
</template>


<script>
import Axios from "axios";
export default {
  data() {
    return {
      msg: "",
      attachmentId: this.$router.history.current.params.attachmentId,
      suffixType: this.$router.history.current.params.suffixType,
      src: "",
      token:this.$router.history.current.params.token,
    };
  },
  mounted() {
    debugger
    let attachmentId = this.attachmentId;
    let suffixType = this.suffixType;
    console.log(suffixType)
    if (suffixType == "doc") {
      this.http.post("/api/poi/doc", { attachmentId }).then(res => {
        if (res.data.code == 201) {
          this.msg = "当前文件不支持在线预览,请下载查看";
        } else {
          let data = res.data.data;
          this.msg = data;
        }
      });
    }
    if (suffixType == "xls") {
      this.http.post("/api/poi/xls", { attachmentId }).then(res => {
        if (res.data.code == 201) {
          this.msg = "当前文件不支持在线预览,请下载查看";
        } else {
          let data = res.data.data;
          this.msg = data;
        }
      });
    }
    if (suffixType == "xlsx") {
      this.http.post("/api/poi/xlsx", { attachmentId }).then(res => {
        if (res.data.code == 201) {
          this.msg = "当前文件不支持在线预览,请下载查看";
        } else {
          let data = res.data.data;
          this.msg = data;
        }
      });
    }
    if (suffixType == "docx") {
      this.http.post("/api/poi/docx", { attachmentId }).then(res => {
        if (res.data.code == 201) {
          this.msg = "当前文件不支持在线预览,请下载查看";
        } else {
          let data = res.data.data;
          this.msg = data;
        }
      });
    }
  }
};
</script>

<style lang="scss">
.content {
  padding: 50px 20%;
  background-color: #fff;
  font-size: 14px;
}
</style>
